﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TN_CMS.Domain.Entities;
using TN_CMS.Framework.Variable;

namespace TN_CMS.Domain.Abstract
{
    public interface ISysFeatureRepository
    {
        IQueryable<SysFeature> SysFeatures { get; }

        List<SysFeature> GetList(int pageIndex, int pageSize, out int total, string orderClause, string whereClause);

        List<SysFeature> GetAllByParentAndProject(int? parentId, EnumProjectType projectType);

        /// <summary>
        /// Get all root features
        /// </summary>
        /// <returns></returns>
        IQueryable<SysFeature> GetAllRoots();

        /// <summary>
        /// Get system feature by Id
        /// </summary>
        /// <param name="Id">Feature Id</param>
        /// <param name="getInactive">Get Inactive feature or not</param>
        /// <returns></returns>
        SysFeature GetDetail(int id, bool getInactive = true);

        /// <summary>
        /// Save system feature, use to update or create new one
        /// </summary>
        /// <param name="detail">SysFeature entity</param>
        /// <returns></returns>
        int Save(SysFeature detail);

        int UpdateActive(int[] arrId, bool isActive);

        /// <summary>
        /// Delete feature(s)
        /// </summary>
        /// <param name="Id">Feature Id(s)</param>
        /// <returns></returns>
        int Delete(int[] arrId);
    }
}
